package com.jsurf;

import java.io.Serializable;
import java.util.Arrays;

public class InterestPoint implements Serializable{
	private static final long serialVersionUID = 1;

	private float x, y;
	
	private float scale;
	
	private float orientation;
	
	private int laplacian;
	
	private float[] descriptor;
	
	private float dx,dy;
	
	private int clusterIndex;

	public InterestPoint(/*float x, float y*/float[] descriptor) {
//		this.x = x;
//		this.y = y;
//		descriptor = new float[64];
		this.descriptor = descriptor;
	}

	public InterestPoint(float x, float y, float scale, int laplacian) {
		this.x = x;
		this.y = y;
		this.scale = scale;
		this.laplacian = laplacian;
	}

	public boolean isEqualTo(InterestPoint point) {
		boolean isEqual = true;
		isEqual &= getX() == point.getX();
		isEqual &= getY() == point.getY();
		isEqual &= getScale() == point.getScale();
		isEqual &= getOrientation() == point.getOrientation();
		isEqual &= getLaplacian() == point.getLaplacian();
		isEqual &= Arrays.equals(getDescriptor(), point.getDescriptor());
		return isEqual;
	}
	
	public float getX() {
		return x;
	}

	public float getY() {
		return y;
	}

	public float getScale() {
		return scale;
	}

	public float getOrientation() {
		return orientation;
	}

	public void setOrientation(float orientation) {
		this.orientation = orientation;
	}

	public int getLaplacian() {
		return laplacian;
	}

	public float[] getDescriptor() {
		return descriptor;
	}

	public void setDescriptor(float[] descriptor) {
		this.descriptor = descriptor;
	}

	public float getDx() {
		return dx;
	}

	public void setDx(float dx) {
		this.dx = dx;
	}

	public float getDy() {
		return dy;
	}

	public void setDy(float dy) {
		this.dy = dy;
	}

	public int getClusterIndex() {
		return clusterIndex;
	}

	public void setClusterIndex(int clusterIndex) {
		this.clusterIndex = clusterIndex;
	}
}
